package com.meilai.project.service.system.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.meilai.project.entity.system.UserRoleRelation;
import com.meilai.project.mapper.system.UserRoleRelationMapper;
import com.meilai.project.service.system.UserRoleRelationService;
import com.meilai.project.vo.system.UserSalesVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 张驰
 * @date 2020/9/11 13:15
 */
@Service
public class UserRoleRelationServiceImpl extends ServiceImpl<UserRoleRelationMapper, UserRoleRelation> implements UserRoleRelationService {
    @Override
    public Integer countUserRelationByRoleId(List<Long> role_ids) {
        return baseMapper.countUserRelationByRoleId(role_ids);
    }

    @Override
    public boolean addUserRoleRelation(UserRoleRelation userRoleRelation) {
        return baseMapper.insert(userRoleRelation) > 0;
    }

    @Override
    public List<UserSalesVO> getSalesman() {
        return baseMapper.getSalesman();
    }

    @Override
    public List<UserSalesVO> getPropertyDevelopment() {
        return baseMapper.getPropertyDevelopment();
    }
}
